/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package simulador;

import smallsimulator.spliterInfo;

/**
 *
 * @author Old
 */
public class Splitter {

    private Simulador s; // Referência para o simulador a que pertence o serviço
    private spliterInfo aInfo = new spliterInfo();
    private String nomeSplitter;
    private int esteId;
        //private Aleatorio randGen;

    public Splitter(Simulador s, spliterInfo info, String nome, int id) {
        aInfo = info;
        this.s = s;
        
        nomeSplitter = nome;
        esteId = id;
        //randGen = new Aleatorio(esteId);
    }
    
    public void insereSplitter (Cliente c){
                int nextId = aInfo.getTarget1();
                //if(RandomGenerator.rand(10)>aInfo.getChance1()){
                if(RandomGenerator.rand(esteId)>aInfo.getChance1()){
                    nextId = aInfo.getTarget2();
                }
		s.insereEvento (new Transito(s.getInstante(), s, (-1)*nextId));
	}
}
